import java.util.Scanner;

public class Testd {
    //打怪升级
    //求约数
    public static int find(int a, int b){
        while(b % a != 0){
            int c = b % a;
            b = a;
            a = c;
        }
        return a;
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNext()){
            int n = scanner.nextInt();
            int m = scanner.nextInt();
            int bi = 0;
            for(int i = 1; i <= n; i++){
                bi = scanner.nextInt();
                if(m >= bi){
                    m += bi;
                }else{
                    m += find(m,bi);
                }
            }
            System.out.println(m);
        }
    }
}
